<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"  xml:lang="zh-CN" lang="zh-CN">
  <head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    <meta name="Robots" content="all"/>
    <meta name="description" content="免费发布广告，免费发布HTML" />
    <meta name="keywords" content="免费发布广告,免费发布HTML" />
    <title>免费发布广告 HTML</title>

    <%= javascript_include_tag 'prototype' %>
    <style type="text/css">
      tr.mouse_over {
        background-color:#F2F8EF;
      }
      table.grid tbody td  {
        border-top:1px dashed #DDDDDD;
        padding:5px 3px;
      }
      .grid{ margin:0 auto;width:900px;}
      body {
        color:black;
        font-family:Arial,sans-serif,Helvetica,Tahoma;
        font-size:12px;
        line-height:1.5;
        text-align:center;
      }
      td {
        font-size:1em;
      }
      .pagination  {
        float:right;
        padding:5px;
      }
      .pagination a, .pagination a:link, .pagination a:visited {
        border:1px solid #AAAADD;
        color:#006699;
        margin:2px;
        padding:2px 5px;
        text-decoration:none;
      }
      .pagination a:hover, .pagination a:active {
        border:1px solid #006699;
        color:#000000;
        text-decoration:none;
      }
      .pagination span.current {
        background-color:#006699;
        border:1px solid #006699;
        color:#FFFFFF;
        font-weight:bold;
        margin:2px;
        padding:2px 5px;
      }
      .pagination span.disabled {
        border:1px solid #EEEEEE;
        color:#DDDDDD;
        margin:2px;
        padding:2px 5px;
      }
      a.underline, .underline a {
        text-decoration:underline;
      }
    </style>

  </head>
  <body>
    <br /><br />
    <% form_for :search ,:url=>webs_path , :html => {:method => :get,:class => "grid"} do |f| %>
      <% f.fields_for @search.conditions do |category| %>
        <table class="grid">
          <thead>
            <tr class="odd">
              <td width="60px">关键字</td>
              <td width="200px"><%= text_field_tag :keywords,params[:keywords],:size => 80 ,:style=>'border:1px solid #006699;
    margin:0;
    padding:1px 3px;' %></td>
              <td width=""> <%= f.submit "查找",:style=>"background:none repeat scroll 0 0 #006699;
    border:1px solid #D2F3FD;
    color:white;
    cursor:pointer;
    font-size:1em;
    height:23px;
    padding:2px 5px;
    vertical-align:middle;" %></td>
            </tr>
          </thead>
        </table>
      <%end%>
    <% end %>
    <p class="grid" style="text-align:right;width:900px"> <%= link_to "免费发布您的广告" , new_web_path  %></p>
    <table class="grid">
      <thead>
        <tr>
          <td>
            序号
          </td>
          <td style="width:150px;">
            <%= order_by_link :sort , :text => '分类'  %>
          </td>
          <td style="width:300px;">
            <%= order_by_link :title , :text => '标题'  %>
          </td>

          <td>
            <%= order_by_link :updated_at , :text => '更新时间'  %>
          </td>
        </tr>
      </thead>
      <tbody>
        <% @webs.each_with_index do |web ,i| %>
          <tr onmouseout="$(this).removeClassName('mouse_over');" onmouseover="$(this).addClassName('mouse_over');" >
            <td>
              <%= i+1  %>
            </td>
            <td>
              <%= link_to_function    h(web.sort_name) ,  "document.getElementById('keywords').value = '#{web.sort_name}';document.getElementById('search_submit').click();" %><br />
            </td>
            <td>
              <%= link_to    h(web.title) ,  web_path(web.name) %><br />
            </td>

            <td>
              <%= web.updated_at.to_s(:db)%>
              <% if current_user && current_user.is_admim? %>
              <%= link_to '编辑', edit_web_path(web) %>|
              <%= link_to '删除', web_path(web), :confirm => 'Are you sure?', :method => :delete %>
              <% end %>
              <br />
            </td>
          </tr>
        <% end %>
        <tr>
          <td colspan="4">
            <%= will_paginate @webs  %>
          </td>
        </tr>
      </tbody>
    </table>
  </body>
</html>
